package com.dsbj.it.DingTalkBotStarter.service.impl;

import com.dsbj.it.DingTalkBotStarter.common.enums.FieldTypeEnum;
import com.dsbj.it.DingTalkBotStarter.dao.entity.DetailDO;
import com.dsbj.it.DingTalkBotStarter.dao.entity.MachinesDO;
import com.dsbj.it.DingTalkBotStarter.dao.mapper.MachinesSaveMapper;
import com.dsbj.it.DingTalkBotStarter.service.MachinesService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import static com.dsbj.it.DingTalkBotStarter.common.enums.FieldTypeEnum.STRING;

@Slf4j
@Service
@RequiredArgsConstructor
public class MachinesServiceImpl extends AbstractExcelBatchSaveServiceImpl<MachinesSaveMapper, MachinesDO> implements MachinesService {

    public void saveMachines() {
        saveFromExcel();
    }

    @Override
    protected String getExcelFilePath() {
        return "D:\\0project\\DingTalkBot\\demo\\file\\input.xlsx";
    }

    @Override
    protected MachinesDO createDO() {
        return MachinesDO.builder().build();
    }

    @Override
    protected FieldTypeEnum getDetailType() {
        return STRING;
    }

    @Override
    protected void setCommonProperties(MachinesDO doEntity, DetailDO detailDO) {
        doEntity.setDetailDO(detailDO);
        doEntity.setSimId(191566089237309850L);
    }


}
